package com.tencent.sr.iris.activity.interfaces.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 事件来源
 */
@AllArgsConstructor
@Getter
public enum ActivityEventSourceEnum {

    USER_REPORT("USER_REPORT", "用户上报"),
    DATASOURCE_PUSH("DATASOURCE_PUSH", "数据源推送"),
    QUFA_PUSH("QUFA_PUSH", "营销中台推送"),
    ADMIN_OPERATE("ADMIN_OPERATE", "手动刷数"),
    ;

    private final String code;
    private final String desc;

    public static ActivityEventSourceEnum getByCode(String code) {
        for (ActivityEventSourceEnum event : ActivityEventSourceEnum.values()) {
            if (event.getCode().equals(code)) {
                return event;
            }
        }
        return null;
    }
}
